import numpy as np


def quick_sort(array):
    """
    这边换了个思路，对数组进行物理拆解后再将其拼接
    先拆解基准数大小两头，然后再对其两头进行递归分治后，再进行拼接
    """
    if len(array) < 2:
        return array
    else:
        pivot = array[0]
        less = [i for i in array[1:] if i <= pivot]
        greater = [i for i in array[1:] if i > pivot]

        return quick_sort(less) + greater + quick_sort(greater)


list_ = np.random.randint(100, size=20)
print(quick_sort(list_))
